const isProduction = process.env.NODE_ENV === 'production';

const plugins = [];
if (isProduction) {
  // 去掉 console.log
  plugins.push(['transform-remove-console', { exclude: ['error', 'warn'] }]);
  // 去掉 debugger
  plugins.push('transform-remove-debugger');
}

module.exports = {
  presets: [
    [
      '@vue/cli-plugin-babel/preset',
      {
        useBuiltIns: 'entry'
      }
    ]
  ],
  plugins: plugins
};
